ctw - capture the web

maxammann

11. Juni, 2019

Lets talk about files

Quelle: PoC||GTFO 0x03

Your browser does not support SVG

Vulnerabilites

Eine Lücke oder Schwäche im Design oder der Implementation eines Systems, welche ausgenutzt werden kann um die Sicherheitsrichtlinie des Systems zu verletzen.


Quelle: IETF RFC 4949

Exploit

Ein Exploit nutzt eine Vulnerability um eine bestimmte unerwartete Aktion auszuführen.

  • Vulnerability muss “exploitable” sein
  • Exploits nutzen einen Payload um gewünschte Aktionen auszuführen

Payload

Beispiel einer XSS

  • Vulterability: XSS
  • Payload: z.B. unser Cookie Stealer oder hier alert("XSS")



Quelle: XSS on Google Search - Sanitizing HTML in The Client? von liveoverflow.com
<div><script title="</div>">

<script><div title="</script>">

Aktuelle HTML-Parser sind zu komplex und zu unterschiedlich.

▶ Serverseitige Sanitisation ist nicht ausreichend!

XSS Sanitisation mit <template>

<noscript><p title="</noscript><img src=x onerror=alert("XSS")>">

DOM Tree für <template> DOM Tree für <div>

Der DOM Tree ist je nach Kontext unterschiedlich, obwohl der ursprüngliche HTML-Code der gleiche ist!

Was passiert hier?

4.12.2 The noscript element
The noscript element represents nothing if scripting is enabled, and represents its children if scripting is disabled.

Da in einem <template> tag scripting deaktiviert ist, werden unterschiedliche DOM Trees gebaut.

  • Vulnerability bestand in der Google Suche für 4 Monate! (git commit)
  • Severity: Very High

Content-Security-Policy to the rescue



CSP is a strong defense-in-depth mechanism against XSS.

Quelle: https://www.w3.org/TR/CSP3/

Verbietet inlinen von JavaScript und lässt nur bestimmte Quellen zu.

Geblockt von CSP:

Google Vulnerability Reward Program payouts in 2018
Google Vulnerability Reward Program payouts in 2018

Was sind CTFs?

  • Capture the Flag sind Wettkämpfe
  • Trainiert Frusttoleranz
  • Anfänger: Ausnutzen eines Buffer-Overflow
  • Profi: Finden iner Zero-Day in Safari 🤯

Grab a beer and ctf!

Quelle: www.securify.nl/en/blog/SFY20180101/spot-the-bug-challenge-2018-warm-up.html

maxammann.org/contact github.com/maxammann